Skip to main content

CREATE-CATALOG

CREATE-CATALOG

Name

CREATE CATALOG

Description

This statement is used to create an external catalog

Syntax:

CREATE CATALOG [IF NOT EXISTS] catalog_name
[PROPERTIES ("key"="value", ...)];

PROPERTIES is the connection information for the catalog. The "type" attribute must be specified, currently supports:

  • hms:Hive MetaStore
  • es:Elasticsearch
  • jdbc: Database access standard interface (JDBC), currently only support jdbc:mysql

Example

  1. Create Catalog for Hive

    CREATE CATALOG hive PROPERTIES (
    "type"="hms",
    'hive.metastore.uris' = 'thrift://172.21.0.1:7004',
    'dfs.nameservices'='HDFS8000871',
    'dfs.ha.namenodes.HDFS8000871'='nn1,nn2',
    'dfs.namenode.rpc-address.HDFS8000871.nn1'='172.21.0.2:4007',
    'dfs.namenode.rpc-address.HDFS8000871.nn2'='172.21.0.3:4007',
    'dfs.client.failover.proxy.provider.HDFS8000871'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
    );
  2. Create Catalog for Elasticsearch

    CREATE CATALOG es PROPERTIES (
    "type"="es",
    "elasticsearch.hosts"="http://127.0.0.1:9200"
    );
  3. Create Catalog for MySQL

    CREATE CATALOG jdbc PROPERTIES (
    "type"="jdbc",
    "user"="root",
    "password"="123456",
    "jdbc_url" = "jdbc:mysql://127.0.0.1:3316/doris_test?useSSL=false",
    "driver_url" = "mysql-connector-java-8.0.25.jar",
    "driver_class" = "com.mysql.cj.jdbc.Driver"
    );

Keywords

CREATE, CATALOG

Best Practice